use axum::{http::StatusCode, response::Html};
use std::fs;

pub async fn get_index() -> Result<Html<String>, (StatusCode, String)> {
    // 读取HTML文件
    let html_content = fs::read_to_string("src/static/index.html")
        .map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, format!("读取HTML文件失败: {}", e)))?;
    
    Ok(Html(html_content))
}
